package com.yupi.yupicturebackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yupi.yupicturebackend.model.dto.user.UserQueryRequest;
import com.yupi.yupicturebackend.model.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.yupicturebackend.model.vo.LoginUserVO;
import com.yupi.yupicturebackend.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author ASUS
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2025-09-11 19:54:32
*/
public interface UserService extends IService<User> {
    //用户注册
    long userRegister(String userAccount, String userPassword, String checkPassword);
    /**
     * 用户登录
     *
     * @param userAccount  用户账户
     * @param userPassword 用户密码
     * @param request
     * @return 脱敏后的用户信息
     */
    LoginUserVO userLogin(String userAccount, String userPassword, HttpServletRequest request);
//    获取当前脱敏登录用户
    LoginUserVO getLoginUserVO(User user);
//    获取当前脱敏用户
    UserVO getUserVO(User user);
    //获取当前登录用户信息列表
    List<UserVO> getUserVOList(List<User> userList);
    //获取当前登录用户
     User getLoginUser(HttpServletRequest  request);

    //登出
    boolean UserLogout(HttpServletRequest request);

    //获取加锁后的密码
    String getEncrypyPassword(String userAccount);

    /**
     * 用户查询
     * @param userQueryRequest
     * @return
     */
    QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);

    /**
     * 是否为管理员
     * @param user
     * @return
     */
    boolean isAdmin(User user);
}
